"""
张量的运算：
计算均值        => data.mean
计算总和        => data.sum
计算n次方        => torch.pow(data,n)
计算平方根       => data.sqrt()
计算指数       => data.exp()
计算对数       => data.log()
"""
import torch
import torch as t

data = t.randint(1, 5, [2, 3], dtype=torch.float64)
print("data2:", data)

data2 = data.mean()
print("均值:", data2)

data3 = data.sum()
print("求和:", data3)

data4 = torch.pow(data, 2)
print("n次方:", data4)

data5 = data.sqrt()
print("平方根:", data5)

data6 = data.exp()
print("指数:", data6)

data7 = data.log()
print("对数:", data7)

